package com.zxw.api.login.controller;

import com.ruyuan.little.project.common.dto.CommonResponse;
import com.zxw.api.login.dto.LoginRequestDTO;
import com.zxw.api.login.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author zxw
 * @date 2021-03-28 16:48
 */
@RestController
@RequestMapping("/login")
public class LoginController {
    @Autowired
    private LoginService loginService;
    @PostMapping("/wxLogin")
    public CommonResponse wxLogin(@RequestBody LoginRequestDTO loginRequestDTO){
        loginService.firstLoginDistributeCoupon(loginRequestDTO);
        return CommonResponse.success();
    }

    @GetMapping("/resetLoginStatus")
    public CommonResponse resetLoginStatus(@RequestParam(value = "phoneNumber")String phoneNumber){
        loginService.resetFirstLoginStatus(phoneNumber);
        return CommonResponse.success();
    }
}
